import React, { Component } from 'react';
import {Route, Switch} from 'react-router-dom'
import Login from './views/Login'
import ForgetPass from './views/ForgetPass'
import BindPhone from './views/BindPhone'
import Index from './containers/IndexContainers'
import PrivateRoute from './components/PrivateRoute'
import './App.css';
import api from './api/login'


const getPcTokenHealthCheck = () =>{
  setInterval(() =>{
      api.getPcTokenHealthCheck({pcToken:sessionStorage.getItem("token")},(res)=>{
          if(res){
              console.log(res);
          }
      })
  },60000)
}
class App extends Component {
  componentWillMount(){
    console.log(this.props)
    getPcTokenHealthCheck()
  }
  state = {
    status: true
  }
  render() {
    return (
      <Switch>
        <Route path="/login" component={Login}/>
        <Route path="/forgetPass" component={ForgetPass}/>
        <Route path="/bindPhone" component={BindPhone}/>
        <PrivateRoute path='/' component={Index}/>        
      </Switch> 
    );
  }
}

export default App;
